<?php

namespace XWAM\Addon\POrgDocument\Controller;

/**
 * LinksController 类
 *
 * @since 1.0 <2015-11-10> SoChishun <14507247@qq.com> Added.
 */
class LinksController extends AddonbaseController {

    function links_list() {
        $list=AddonD('Links')->get_paging_list($where,$show);
        $this->assign('list',$list);
        $this->assign('page',$show);
        $this->display_cpp();
    }
    
    function change_sort($id, $sort){
        $this->ajaxReturn(AddonD('Links')->change_sort($id,$sort));
    }

    function link_edit($id = 0) {
        $data = array();
        if ($id) {
            $data = AddonD('Links')->find($id);
        }
        $this->assign('data', $data);
        $this->display();
    }

    function link_edit_save() {
        $result = AddonD('Links')->save_link();
        $this->dialogJump($result['status'], $result['info']);
    }

    function link_delete($id = '') {
        $result = AddonD('Links')->delete_link($id);
        $this->ajaxReturn($result);
    }

}
